package com.kchouse.homepage;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.kchouse.R;
import com.kchouse.common.BaseActivity;

public class ToolkitActivity extends BaseActivity implements View.OnClickListener{

    private ToolkitActivity mContent;
    private TextView tv_title;
    private ImageView iv_back;
    private View rl_calculator;
    private Intent intent;
    private View rl_offermanage;
    private View rl_depositmanagement;
    private View rl_workordermanage;
    private View rl_remindset;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_toolkit);

        mContent = this;
        intiData();
        intiView();
    }

    private void intiView() {
        tv_title = (TextView) findViewById(R.id.tv_title);
        tv_title.setText("工具箱");
        iv_back = (ImageView) findViewById(R.id.iv_back);
        iv_back.setOnClickListener(this);

        rl_calculator =  findViewById(R.id.rl_calculator);
        rl_calculator.setOnClickListener(this);
        rl_offermanage =  findViewById(R.id.rl_offermanage);
        rl_offermanage.setOnClickListener(this);
        rl_depositmanagement =  findViewById(R.id.rl_depositmanagement);
        rl_depositmanagement.setOnClickListener(this);
        rl_workordermanage =  findViewById(R.id.rl_workordermanage);
        rl_workordermanage.setOnClickListener(this);
        rl_remindset =  findViewById(R.id.rl_remindset);
        rl_remindset.setOnClickListener(this);
    }

    private void intiData() {

        intent=getIntent();
    }

    @Override
    public void onClick(View v) {
        switch (v.getId())
        {
            case R.id.iv_back:
                finish();
                break;
            case R.id.rl_calculator://油耗计算器
//                intent.setClass(mContent,CalculatorActivity.class);
//                startActivity(intent);
                break;
            case R.id.rl_offermanage://报价管理
                intent.setClass(mContent,OffermanageActivity.class);
                startActivity(intent);
                break;
            case R.id.rl_depositmanagement://定金管理
                intent.setClass(mContent,DepositmanagementActivity.class);
                startActivity(intent);
                break;
            case R.id.rl_workordermanage://工单管理
                intent.setClass(mContent,WorkordermanagementActivity.class);
                startActivity(intent);
                break;
            case R.id.rl_remindset://提醒设置
                intent.setClass(mContent,RemindsetActivity.class);
                startActivity(intent);
                break;
        }
    }
}
